<template>
  <div class="app-main">
    <div class="section-main">
        <div class="title">
          <div class="img-font">
              <img  src="../../../assets/img/jianjun/font.png" alt="">
          </div>
          <div class="img-bird">
               <img src="../../../assets/img/jianjun/bird.png" alt="">
          </div>
        </div>
        <p class="content" v-text="content"></p>
    </div>
    <div class="cutimg">
        <div class="img-div">
          <img :src="imgUrl" alt="">
        </div>
      </div>
      <div class="section-bottom">
        <img src="../../../assets/img/jianjun/bottom.png" alt="" class="img-fenche">
          <div class="show-div" @click="suremake">
            <btn-router
              :background='require("../../../assets/img/jianjun/btn1.png")'
              :width=261
              :height=42
              size='14'
            >生成贺卡</btn-router>
          </div>
          <div class="back-div" @click="goback" >
            <btn-router
              :background='require("../../../assets/img/jianjun/btn1.png")'
              :width=261
              :height=42
              size='14'
            >返回上级</btn-router>
          </div>
    </div>
  </div>
</template>

<script>
import btnRouter from '@/components/routerButton'// 跳转按钮组件
import { mapState } from 'vuex'

console.log(mapState)
export default {
  name: 'Show',
  data () {
    return {
    }
  },
  computed: {
    ...mapState({
      imgUrl: state => state.file.imgUrl,
      content: state => state.file.content
    })
  },
  components: {
    btnRouter
  },
  methods: {

    goback () {
      this.$router.go(-1)
    },
    suremake () {
      if (this.imgUrl) {
        var imgfile = this.convertBase64UrlToBlob(this.imgUrl)
        console.log(imgfile)
      }
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .app-main{background:url(../../../assets/img/jianjun/background.png) no-repeat top left;background-size:cover}
  .app-main::before{content: '';width: 5.76rem;height: 2.7rem;background:url(../../../assets/img/jianjun/start.png) no-repeat top left;background-size:contain;position: absolute}
  .section-main{position:relative;top:1rem;margin: 0 auto;width:5.5rem}
  .content{width:100%;overflow: hidden;;padding:5%;font-size:14px;word-break:break-all}
  .title{width:100%;position: relative;}
  .title .img-font{width:50%;position: relative;left:20%}
  .title .img-bird{width: 40%;position: absolute;top: 20%;right: 0;}
  .title img{width:100%}
  .cutimg{position:absolute;right:0.1rem;bottom:1.5rem;width:2.54rem;height:3.18rem;background:url(../../../assets/img/jianjun/photo.png) no-repeat top left;background-size:contain}
  .img-div{margin:0 auto;width:1.8rem;height:1.8rem;border-radius: 50%;overflow: hidden;}
  .cutimg img{width:100%;}
  .section-bottom{position:absolute;bottom:0;width:100%}
  .section-bottom img{position:absolute;bottom:0;width:100%}
  .show-div{position:relative;bottom:.2rem;left:1rem;display:inline-block}
  .back-div{position:relative;right:1rem;bottom:.2rem;float:right;display:block}
</style>
